<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/core/ipv4/icmp.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('icmp_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">icmp.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="opt_8h.html">lwip/opt.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="icmp_8h.html">lwip/icmp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="inet__chksum_8h.html">lwip/inet_chksum.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ip_8h.html">lwip/ip.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="def_8h.html">lwip/def.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="stats_8h.html">lwip/stats.h</a>&quot;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &quot;path/to/my/lwip_hooks.h&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a6b9fd6be0a7dcf301bc86b9e96e3857e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp_8c.html#a6b9fd6be0a7dcf301bc86b9e96e3857e">LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a6b9fd6be0a7dcf301bc86b9e96e3857e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ac929e48a1dddf98050b73a2633fcaef1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp_8c.html#ac929e48a1dddf98050b73a2633fcaef1">icmp_input</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, struct <a class="el" href="structnetif.html">netif</a> *inp)</td></tr>
<tr class="separator:ac929e48a1dddf98050b73a2633fcaef1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae26c59eab4ce553964a0c9d43f534d06"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp_8c.html#ae26c59eab4ce553964a0c9d43f534d06">icmp_dest_unreach</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, enum <a class="el" href="icmp_8h.html#a17637465f209385e5d19ef47fd9266a5">icmp_dur_type</a> t)</td></tr>
<tr class="separator:ae26c59eab4ce553964a0c9d43f534d06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49723e5e11c4bbc86197e58fdca7c119"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icmp_8c.html#a49723e5e11c4bbc86197e58fdca7c119">icmp_time_exceeded</a> (struct <a class="el" href="structpbuf.html">pbuf</a> *p, enum <a class="el" href="icmp_8h.html#a058d0a0769bd38db99fc6fd1dad1324a">icmp_te_type</a> t)</td></tr>
<tr class="separator:a49723e5e11c4bbc86197e58fdca7c119"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>ICMP - Internet Control Message Protocol </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a6b9fd6be0a7dcf301bc86b9e96e3857e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b9fd6be0a7dcf301bc86b9e96e3857e">&#9670;&nbsp;</a></span>LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Small optimization: set to 0 if incoming PBUF_POOL pbuf always can be used to modify and send a response packet (and to 1 if this is not the case, e.g. when link header is stripped off when receiving) </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ae26c59eab4ce553964a0c9d43f534d06"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae26c59eab4ce553964a0c9d43f534d06">&#9670;&nbsp;</a></span>icmp_dest_unreach()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icmp_dest_unreach </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="icmp_8h.html#a17637465f209385e5d19ef47fd9266a5">icmp_dur_type</a>&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send an icmp 'destination unreachable' packet, called from <a class="el" href="group__lwip__nosys.html#ga3c420dab0c6760df099a2d688fa42a26">ip_input()</a> if the transport layer protocol is unknown and from <a class="el" href="udp_8c.html#a7b338a5515606bd51976fbc5bcec9611">udp_input()</a> if the local port is not bound.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the input packet for which the 'unreachable' should be sent, p-&gt;payload pointing to the IP header </td></tr>
    <tr><td class="paramname">t</td><td>type of the 'unreachable' packet </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ac929e48a1dddf98050b73a2633fcaef1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac929e48a1dddf98050b73a2633fcaef1">&#9670;&nbsp;</a></span>icmp_input()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icmp_input </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> *&#160;</td>
          <td class="paramname"><em>inp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Processes ICMP input packets, called from <a class="el" href="group__lwip__nosys.html#ga3c420dab0c6760df099a2d688fa42a26">ip_input()</a>.</p>
<p>Currently only processes icmp echo requests and sends out the echo response.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the icmp echo request packet, p-&gt;payload pointing to the icmp header </td></tr>
    <tr><td class="paramname">inp</td><td>the netif on which this packet was received </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a49723e5e11c4bbc86197e58fdca7c119"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a49723e5e11c4bbc86197e58fdca7c119">&#9670;&nbsp;</a></span>icmp_time_exceeded()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icmp_time_exceeded </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="icmp_8h.html#a058d0a0769bd38db99fc6fd1dad1324a">icmp_te_type</a>&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Send a 'time exceeded' packet, called from ip_forward() if TTL is 0.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the input packet for which the 'time exceeded' should be sent, p-&gt;payload pointing to the IP header </td></tr>
    <tr><td class="paramname">t</td><td>type of the 'time exceeded' packet </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.html">core</a></li><li class="navelem"><a class="el" href="dir_a32e111ee6805cfc63488fd2d37f2390.html">ipv4</a></li><li class="navelem"><a class="el" href="icmp_8c.html">icmp.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
